﻿@model ScmDailycheckViewModel
@{
    ViewBag.Title = "日常检查-新增";
    Layout = null;
}
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function prochange() {
        var dialog = $("body").data("ctgl_jc_add");
        var isPro = $("#sel_pro").val();
        if (isPro == "true") {
            $.pdialog.resizeDialog({ style: { height: 500, top: 120} }, dialog, "");
            $.pdialog.switchDialog(dialog);
            $("#div_problem").attr("style", "");
        }
        if (isPro == "false") {
            $.pdialog.resizeDialog({ style: { height: 230, top: 250} }, dialog, "");
            $.pdialog.switchDialog(dialog);
            $("#div_problem").attr("style", "display:none;");
        }
    }
    function typechange() {
        var code = $("select[name='TheDailycheckInfo.Dc_TypeCode']:eq(0)").val();
        var name = $("select[name='TheDailycheckInfo.Dc_TypeCode']:eq(0) option[value='" + code + "']").html();
        $("#TheDailycheckInfo_Dc_TypeName").val(name);
        $("#TheDailycheckInfo_Dc_BeCheckedDepID").val("");
        $("#TheDailycheckInfo_Dc_BeCheckedDepName").val("");
        $("#TheDailycheckInfo_Dc_BeCheckedSection").val("");
      
        $("#a_selectUnit").attr("href", "/SafetyConstruction/ProjectSegment/UnitListByDailyCheck?type=" + code + "&uId=TheDailycheckInfo_Dc_BeCheckedDepID&uName=TheDailycheckInfo_Dc_BeCheckedDepName&uSection=TheDailycheckInfo_Dc_BeCheckedSection");
       
    }
</script>
@{Html.EnableClientValidation();}
@using (Html.BeginForm("DailyCheckAdd", "ScmDailyCheck", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogAjaxDone);", @class = "pageForm required-validate" }))
{
@*<form method="post" action="@Url.Action("DailyCheckAdd", "ScmDailyCheck")" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">*@
<div class="pageFormContent" layouth="58">
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_ID, new { @type = "hidden" })
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_State, new { @type = "hidden" })
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_OperateUserID, new { @type = "hidden" })
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_OperateUserName, new { @type = "hidden" })
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_CheckDepID, new { @type = "hidden" })
    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_CheckDepName, new { @type = "hidden" })
    <table class="tab01 tabNo" width="100%;">
        <tr>
            <td class="td1" style="width:30%;">
                被检单位类型：
            </td>
            <td>
                @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_TypeName, new { @type = "hidden", Value = "施工单位" })
                @Html.DropDownListFor(m => m.TheDailycheckInfo.Dc_TypeCode, new SelectList(Model.TheSafetyconstructiondicList, "Scd_Code", "Scd_Name")
                    , new { @onchange = "typechange()" })
            </td>
        </tr>
        <tr>
            <td class="td1">
                被检单位：
            </td>
            <td>
                @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_BeCheckedDepID, new { @type = "hidden" })
                 @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_BeCheckedDepName, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(m => m.TheDailycheckInfo.Dc_BeCheckedDepName)
               @* @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_BeCheckedDepName, new { @class = "required input02", @readonly = "readonly" })*@
                <a id="a_selectUnit" class="btnLook" href="@Url.Action("UnitListByDailyCheck", "ProjectSegment", new { type = "1", uId = "TheDailycheckInfo_Dc_BeCheckedDepID", uName = "TheDailycheckInfo_Dc_BeCheckedDepName", uSection = "TheDailycheckInfo_Dc_BeCheckedSection" })" rel="ctgl_jc_unit" lookupgroup="TheDailycheckInfo" title="选择被检单位">
                    查找带回</a>
            </td>
        </tr>
        <tr>
            <td class="td1">
                被检单位标段：
            </td>
            <td>
                @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_BeCheckedSection, new { @class = "required input02", @readonly = "readonly" })
            </td>
        </tr>
        <tr>
            <td class="td1">
                检查时间：
            </td>
            <td>
                @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_CheckTime, new { @class = "date required input02", @readonly = "readonly", Value = Model.TheDailycheckInfo.Dc_CheckTime.ToString("yyyy-MM-dd") })
                @*<a href="javascript:void(0)" class="inputDateButton">选择</a>*@
            </td>
        </tr>
        <tr>
            <td class="td1">
                是否存在问题：
            </td>
            <td>
                @Html.DropDownListFor(m => m.TheDailycheckInfo.Dc_IsPro, ViewBag.list as IEnumerable<SelectListItem>, new { @id = "sel_pro", @onchange = "prochange()" })
            </td>
        </tr>
    </table>
    <div id="div_problem" style="display: none;">
        <table class="tab01 tabNo" width="100%;">
            <tr>
                <td class="td1" style="width:30%;">
                    问题简写：
                </td>
                <td>
                    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_BriefProblem, new { @size = "70",@class="input02" })
                </td>
            </tr>
            <tr>
                <td class="td1">
                    问题详情：
                </td>
                <td>
                    @Html.TextAreaFor(m => m.TheDailycheckInfo.Dc_DetailsProblem, new { @cols = "80", @rows = "5" , @class="input05" })
                </td>
            </tr>
            <tr>
                <td class="td1">
                    整改期限：
                </td>
                <td>
                    @Html.TextBoxFor(m => m.TheDailycheckInfo.Dc_CorrectTime, new { @class = "date input02", @readonly = "readonly" })
                    @*<a href="javascript:void(0)" class="inputDateButton">选择</a>*@
                </td>
            </tr>
            <tr>
                <td class="td1">
                    整改要求：
                </td>
                <td>
                    @Html.TextAreaFor(m => m.TheDailycheckInfo.Dc_CorrectDemand, new { @cols = "80", @rows = "5",@class="input05" })
                </td>
            </tr>
        </table>
    </div>
    <table class="tab01 tabNo" width="100%">
        <tr>
            <td class="td1" style="width:30%;">
                附件：
            </td>
            <td>
                <input id="AssistID" name="AssistID" value="@ViewBag.AssisId" type="hidden" />
                <a href='/Common/UploaderFile/Uploader/?id=ZDFileID' width="710" height="460" rel="rel_WorkFlow_WorksMeasure_Attach"
                    mask="true" target="dialog" title="附件管理">
                    <img src="/Content/themes/default/images/fj.gif" alt="查看附件" id='ZDFileID'
                         uploaderoption="{MoudleID:@ViewBag.MoudleID,'ToSelectIDs':[@ViewBag.FileIds],'ToDeleteIDs':[@ViewBag.DeleteIds],BizDeleteURL:'/SafetyConstruction/Base/Delete/',BizSaveUrl:'/SafetyConstruction/Base/BatchAdd/',BizType:'DailyCheck_Rules',BizID:'@ViewBag.AssisId','dirWhere':'@ViewBag.DirWhere'}" />
                </a>
            </td>
        </tr>
    </table>
</div>
<div class="formBar">
    <ul>
        <li>
            <button type="submit" class="btn btn-sm">
                保存</button>
        </li>
        <li>
            <button type="button" class="close btn btn-default btn-sm">
                取消</button>
        </li>
    </ul>
</div>
@*</form>*@
}
